package com.ying.consumer10001.fegin;
import com.ying.consumer10001.domain.DoMain;
import com.ying.consumer10001.pack.R;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

//服务降级处理
@Component
public class ProvFallBackFactory implements FallbackFactory<Object> {
    @Override
    public Object create(Throwable throwable) {
        return new Provider9001Fegin() {
            @Override
            public R getdomain(Long id) {
                return new R().setMessage("getdomain服务暂时不可用！！");
            }

            @Override
            public R deletedomain(Long id) {
                return new R().setMessage("deletedomain服务暂时不可用！！");
            }

            @Override
            public R updatedomain(DoMain doMain) {
                return new R().setMessage("updatedomain服务暂时不可用！！");
            }

            @Override
            public R insertdomain(DoMain doMain) {
                return new R().setMessage("insertdomain服务暂时不可用！！");
            }
        };
    }
}
